package com.example.psysystemhomework.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;

import com.example.psysystemhomework.R;

import java.util.ArrayList;

public class FirstAdapter extends BaseAdapter {
    private ArrayList<String> a = new ArrayList<>();
    private Context context;

    public FirstAdapter(Context context) {
        this.context = context;
        for (int i = 0; i < 10; i++) {
            a.add("a1");
        }
    }

    public ArrayList<String> getA() {
        return a;
    }

    @Override
    public int getCount() {
        return a.size();
    }

    @Override
    public Object getItem(int i) {
        return a.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        view = View.inflate(context, R.layout.item_first, null);
        ViewHolder viewHolder = new ViewHolder(view);

        return view;
    }

    public static class ViewHolder {
        LinearLayout mBackItem;

        public ViewHolder(View itemView) {
            this.mBackItem = itemView.findViewById(R.id.back_item);
        }
    }
}
